$.ajaxSetup({
    async: false
});

//获取并排列出主页的review
$.get("/home/topReviews",function (data) {
    for(var i=0;i<data.length;i++){
        var review=$("<div class='jumbotron' tid='"+data[i].tid+"'>\n" +
            "    <span class='img-span'></span>\n" +
            "    <h3><span class='glyphicon glyphicon-star'></span>"+data[i].title+"</h3>\n" +
            "    <p>"+data[i].content.replace(new RegExp("\n","g"),"<br>")+"</p>\n" +
            "</div>");

        $("#reviews").append(review);
    }
});

//获取并排列出主页的几张顶层照片
$.get("/home/topImg",function (data) {
    var imgAre=$("#introduce-img");

    for(var i=0;i<data.length;i++){
        var img=$("<div class='col-xs-3 col-md-2'>\n" +
            "    <a href='/html/resume.html?id="+data[i].id+"' class='thumbnail'>\n" +
            "        <img src='"+data[i].data+"'>\n" +
            "    </a>\n" +
            "</div>");

        var imgReview=$("<img src='"+data[i].data+"' height='150px' class='pull-right' style='padding: 0 30px'></span>");

        $("#reviews").find(".jumbotron[tid="+data[i].id+"]").find(".img-span").append(imgReview);

        imgAre.append(img);
    }
});

getCity($("#city"));
getLanguage($("#language"));